﻿using Microsoft.Silverlight.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace WaitLess.Business.Tests.Common
{
    public abstract class AsyncTestBase : SilverlightTest
    {
        protected bool IsActCompleted { get; set; }

        [Asynchronous]
        [TestInitialize]
        public void ExecuteTest()
        {
            Arrange();
            Act();
            EnqueueConditional(() => IsActCompleted);
            EnqueueTestComplete();
        }

        protected virtual void Arrange()
        {
        }

        protected virtual void Act()
        {
        }
    }
}
